package com.serkol.driving.learning.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.serkol.bean.MyPage;
import com.serkol.driving.learning.entity.SysRole;
import com.serkol.driving.learning.mapper.SysRoleMapper;
import com.serkol.driving.learning.service.SysRoleService;
import org.springframework.stereotype.Service;

/**
* @author pingan
* @description 针对表【sys_role】的数据库操作Service实现
* @createDate 2022-10-07 17:05:12
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
    implements SysRoleService{

    @Override
    public MyPage findByList(int pageSize, int current) {
        QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().orderByDesc(SysRole::getId);
        Page<SysRole> page = new Page<>(current, pageSize);
        Page<SysRole> mapPage = this.baseMapper.selectPage(page, queryWrapper);
        return MyPage.parsePage(mapPage);
    }
}




